package com.neusoft.service.impl;

import com.neusoft.mapper.BusinessAdminMapper;
import com.neusoft.po.BusinessAdmin;
import com.neusoft.service.BusinessAdminService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessAdminServiceImpl implements BusinessAdminService {

    @Autowired
    private BusinessAdminMapper businessAdminMapper;

    @Override
    public List<BusinessAdmin> listBusiness(String businessName,
                                            String businessAddress) {
        return businessAdminMapper.ListBusiness(businessName, businessAddress);
    }

    @Override
    public int saveBusiness(BusinessAdmin business) {
        return businessAdminMapper.saveBusiness(business);
    }

    @Override
    public int removeBusiness(int businessId) {
        return businessAdminMapper.removeBusiness(businessId);
    }

    @Override
    public BusinessAdmin getBusinessByIdByPass(Integer businessId, String password) {
        return businessAdminMapper.getBusinessByIdByPass(businessId, password);
    }
    @Override
	public int getById(String businessId) {
		return businessAdminMapper.getById(businessId);
	}
    @Override
    public BusinessAdmin getBusinessById(Integer businessId) {
        return businessAdminMapper.getBusinessById(businessId);
    }

    @Override
    public int updateBusiness(Integer businessId,String password,String businessName,String businessAddress,String businessExplain,Double starPrice,Double deliveryPrice,String businessImg) {
        return businessAdminMapper.updateBusiness(businessId,password,businessName,businessAddress,businessExplain,starPrice,deliveryPrice,businessImg);
    }

    @Override
    public int updateBusinessByPassword(Integer businessId, String password) {
        return businessAdminMapper.updateBusinessByPassword(businessId, password);
    }
}